<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>数组去重</title>
	<script type="text/javascript">
		var arr = [11,2,2,2,'hello','world','hello'];

		// var newArr = [11,2,'hello','world'];
		function removeArrSameEle(arr){
			var newArr = [];
			for( var i in arr ){
				// if(newArr.indexOf(arr[i]) == -1){
				// 	newArr.push(arr[i]);
				// }
				if( newArr.includes(arr[i]) == false ){
					newArr.push(arr[i]);
				}
			}
			return newArr;
		}
		console.log(removeArrSameEle(arr))

		// cv工程师
	</script>
</head>
<body>

</body>
</html>